package com.econ.powercloud.ems.service.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.econ.powercloud.ems.dal.entity.EmsTimingControl;
import com.econ.powercloud.ems.dal.mapper.EmsTimingControlMapper;
import org.springframework.stereotype.Repository;

/**
 * @Author : zjf
 * @Description :
 * @Date : 2023/8/15 15:14
 * @Modified by : zjf
 */
@Repository
public class EmsTimingControlDAO extends ServiceImpl<EmsTimingControlMapper, EmsTimingControl> {

    public Page<EmsTimingControl> selectPageByCondition(Integer status,Integer pageNo,Integer pageSize){
        LambdaQueryWrapper<EmsTimingControl> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(status != null,EmsTimingControl::getStatus,status);
        Page<EmsTimingControl> page = new Page<>(pageNo,pageSize);
        return this.baseMapper.selectPage(page,wrapper);
    }

}
